package com.wanji.gateway.config;


import cn.hutool.core.collection.CollUtil;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;

import java.util.Set;

@Configuration
@ConfigurationProperties(prefix = "gateway")
@Data
@EnableScheduling
public class GatewayConfig {

    private Set<Integer> ports = CollUtil.newHashSet(10000);


    /**
     * 写速率限制，单位：字节/秒，0表示无限制
     */
    @Value("${gateway.traffic.write-limit:0}") //
    private long writeLimit;

    /**
     * 读速率限制，单位：字节/秒，0表示无限制
     */
    @Value("${gateway.traffic.read-limit:0}")
    private long readLimit;


    /**
     * 检查间隔，单位：毫秒
     */
    @Value("${gateway.traffic.check-interval:1000}")
    private long checkInterval;

}
